﻿@model MasResourceSubGroup

@Html.HiddenFor(model => model.ResGrpId)
@Html.HiddenFor(model => model.RecordStatus)

<div class="widget-box">
    <div class="widget-header header-color-blue2">
        <h4 class="lighter smaller">กลุ่มพัสดุ</h4>
    </div>
    <div class="widget-body">
        <div class="widget-body-inner">
            <div class="widget-main form-horizontal">
                <div class="control-group">
                    <div class="control-label">
                        @Html.DisplayNameFor(model => model.Code)
                    </div>
                    <div class="controls-detail" style="margin-top:5px !important;">
                        @Html.DisplayFor(model => model.Code)
                    </div>
                </div>
                <div class="control-group">
                    <div class="control-label">
                        @Html.DisplayNameFor(model => model.OldCode)
                    </div>
                    <div class="controls-detail" style="margin-top:5px !important;">
                        @Html.DisplayFor(model => model.OldCode)
                    </div>
                </div>
                <div class="control-group">
                    <div class="control-label">
                        @Html.DisplayNameFor(model => model.Name)
                    </div>
                    <div class="controls-detail" style="margin-top:5px !important;">
                        @Html.DisplayFor(model => model.Name)
                    </div>
                </div>
                <div class="control-group">
                    <div class="control-label">
                        @Html.DisplayNameFor(model => model.ResGrpId)
                    </div>
                    <div class="controls-detail" style="margin-top:5px !important;">
                        @Model.MasResourceGroup.Code - @Model.MasResourceGroup.Name
                    </div>
                </div>
                <div class="control-group">
                    <div class="control-label">
                        @Html.DisplayNameFor(model => model.DpTypeId)
                    </div>
                    <div class="controls-detail" style="margin-top:5px !important;">
                        @{
                            var dpTypeObj = new KPIS.GERP.WEB.GIMS.MasDepreciationTypeService.MasDepreciationTypeServiceClient()
                                .SelectMasDepreciationType(new MasDepreciationType{RecordStatus = "!D"}, null).FirstOrDefault(o=>o.DpTypeId== Model.DpTypeId);
                            var dpTypeName = dpTypeObj == null ? "<span class='grey'>ไม่เลือก</span>'" : dpTypeObj.Name;
                        }
                        @Html.Raw(dpTypeName)
                    </div>
                </div>
                <div class="control-group">
                    <div class="control-label">
                        @Html.DisplayNameFor(model => model.Descr)
                    </div>
                    <div class="controls-detail" style="margin-top:5px !important;">
                        @Html.DisplayFor(model => model.Descr)
                    </div>
                </div>
                <div class="control-group">
                    <div class="control-label">
                        @Html.DisplayNameFor(model => model.UnspscCode)
                    </div>
                    <div class="controls-detail" style="margin-top:5px !important;">
                        @Html.DisplayFor(model => model.UnspscCode)
                    </div>
                </div>
                <div class="control-group">
                    <div class="control-label">
                        @Html.DisplayNameFor(model => model.IncCode)
                    </div>
                    <div class="controls-detail" style="margin-top:5px !important;">
                        @Html.DisplayFor(model => model.IncCode)
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>